Feat/android 17 - #59
Conversation
…ation to F-Droid repository data
…hain - compileSdk + targetSdk: 36 → 37 (Android 17 / API 37) - Removed compileSdkExtension (not needed for base API 37) - Java source/target compatibility: VERSION_11 → VERSION_17 - Kotlin jvmTarget: 11 → 17 - Gradle wrapper: 8.12 → 8.14.1 - AGP: 8.9.1 → 8.11.1 - Kotlin Gradle Plugin: 2.1.0 → 2.2.20 - Enable android.builtInKotlin=true + android.newDsl=true - Remove explicit id(kotlin-android) plugin (now injected by Flutter)
WalkthroughThe project updates its Flutter SDK constraint, Android build toolchain, and package dependencies. Android configuration adopts newer Gradle, Kotlin, Java, and SDK versions. Documentation and Android metadata now reference the RepForge repository. ChangesToolchain alignment
Repository references
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@workout-logger/android/app/build.gradle.kts`:
- Around line 5-22: Replace the kotlinOptions block in the android module
configuration with the Kotlin 2.x compilerOptions DSL, preserving the Java 17
JVM target. Do not re-add the org.jetbrains.kotlin.android plugin; keep the
existing built-in Kotlin setup and surrounding compileOptions unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 555cf4b0-3fea-4724-aa58-626b533089c1
⛔ Files ignored due to path filters (1)
workout-logger/pubspec.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
workout-logger/android/app/build.gradle.ktsworkout-logger/android/gradle.propertiesworkout-logger/android/gradle/wrapper/gradle-wrapper.propertiesworkout-logger/android/settings.gradle.ktsworkout-logger/pubspec.yaml
|
@coderabbitai with this auto update tags do we have to remove the kotlin dep from the Buildgradle.kts or similar file ? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
fd build.gradle.kts -a
echo "---app build.gradle.kts---"
cat -n workout-logger/android/app/build.gradle.kts
echo "---settings.gradle.kts---"
cat -n workout-logger/android/settings.gradle.kts
echo "---gradle.properties---"
cat -n workout-logger/android/gradle.properties
echo "---search for kotlin references---"
rg -n "kotlin" workout-logger/android --iglob '*.kts' --iglob '*.properties'Length of output: 7313 🤖 web_search executed:
Length of output: 2459 🤖 web_search executed:
Length of output: 6629 🤖 web_search executed:
Length of output: 4403 🤖 web_search executed:
Length of output: 4401 🤖 web_search executed:
Length of output: 10136
Short answer: no, you don't need to remove the Kotlin plugin from Why:
So, to summarize both flags:
They were added automatically by the Flutter migrator as forward-looking placeholders, and they don't cause any harm sitting in If you want built-in Kotlin to actually activate, that would require a separate, larger effort: bumping AGP to 9.0+ in Let me know if you'd like me to open a follow-up issue to track the AGP 9 / built-in Kotlin migration. (•‾_•) — curious to see how the AGP 9 migration shakes out when you're ready for it. ✏️ Learnings added
|
|
@coderabbitai nice catch what would be the changes for moving to latest AGP? 9.00 or above, what changes in the gh action would come? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
fd -e yml -e yaml . .github/workflows 2>/dev/null
echo "---workflows---"
for f in $(fd -e yml -e yaml . .github/workflows 2>/dev/null); do
echo "=== $f ==="
cat -n "$f"
done
echo "---app build.gradle.kts full---"
cat -n workout-logger/android/app/build.gradle.kts
echo "---settings.gradle.kts---"
cat -n workout-logger/android/settings.gradle.ktsLength of output: 16350 🤖 web_search executed:
Length of output: 5339 🤖 web_search executed:
Length of output: 8400
1. Version bumps required
Important catch: The official compileSdk/AGP compatibility table lists API level 37 as requiring minimum AGP 2.
|
|
@coderabbitai open a separate issue for this, to be tracked in another pr |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="Devasy/RepForge"
body=$(cat <<'EOF'
## Summary
Follow-up to `#59`: migrate `workout-logger/android` to Android Gradle Plugin (AGP) 9.0+ to actually activate the `android.builtInKotlin` and `android.newDsl` gradle.properties flags that were added automatically by the Flutter migrator in `#59`. On the current AGP version (8.11.1), these flags are inert placeholders because Flutter's Gradle plugin only enables built-in Kotlin support when AGP major version >= 9.
## Background
- `workout-logger/android/gradle.properties` sets `android.builtInKotlin=true` and `android.newDsl=true`, but Flutter's Gradle plugin (`FlutterPluginUtils.isBuiltInKotlinEnabled`) explicitly forces this to `false` when AGP major version < 9.
- The project currently pins `com.android.application` and `org.jetbrains.kotlin.android` to 8.11.1 / 2.2.20 in `workout-logger/android/settings.gradle.kts`.
- Official AGP compileSdk compatibility tables list API level 37 (already targeted in `#59`) as requiring minimum AGP 9.1.1, not just 9.0.1.
## Required changes
1. **`workout-logger/android/settings.gradle.kts`**
- Bump `com.android.application` plugin version to `9.1.1`+ (not just `9.0.1`, due to compileSdk 37 compatibility requirements).
- Remove the `org.jetbrains.kotlin.android` plugin declaration entirely — AGP 9's new DSL is not compatible with the standalone Kotlin Android plugin; built-in Kotlin support handles this instead.
2. **`workout-logger/android/gradle/wrapper/gradle-wrapper.properties`**
- Bump Gradle distribution to `>= 9.1.0` (AGP 9.0's minimum Gradle requirement).
3. **`workout-logger/android/app/build.gradle.kts`**
- Rewrite the ABI-specific `versionCodeOverride` logic, currently implemented via the legacy `android.applicationVariants.configureEach { ... }` API (casting output to `ApkVariantOutputImpl`), using the new `androidComponents.onVariants(...)` variant API. This is the biggest non-trivial code change required.
- Migrate the `kotlinOptions { jvmTarget = ... }` block to the built-in-Kotlin equivalent DSL (e.g., `kotlin { compilerOptions { jvmTarget = ... } }`), verifying against Flutter's built-in Kotlin migration docs at the time of the upgrade.
4. **Compatibility verification (risk items, not pure version bumps)**
- Confirm Flutter's `flutter-gradle-plugin` (pinned via Flutter SDK `3.44.4`+ per `#59`) has stable-channel support for AGP major version 9 before committing to the bump.
- Re-verify the F-Droid signing-block-stripping logic in `app/build.gradle.kts` (the comment about `signingConfig` needing to stay on one line) still holds under the new DSL/variant API.
## Affected files
- `workout-logger/android/settings.gradle.kts`
- `workout-logger/android/gradle/wrapper/gradle-wrapper.properties`
- `workout-logger/android/app/build.gradle.kts`
- `workout-logger/android/gradle.properties` (flags already in place from `#59`, will become active)
## Acceptance criteria
- [ ] AGP bumped to `9.1.1`+ in `settings.gradle.kts`, `org.jetbrains.kotlin.android` plugin declaration removed.
- [ ] Gradle wrapper bumped to `>= 9.1.0`.
- [ ] `android.applicationVariants.configureEach` ABI versionCode logic migrated to `androidComponents.onVariants(...)`.
- [ ] `kotlinOptions.jvmTarget` migrated to the built-in-Kotlin equivalent.
- [ ] Flutter Gradle plugin / Flutter SDK version confirmed compatible with AGP 9 on stable channel.
- [ ] F-Droid build (signing block stripping) verified to still work correctly.
- [ ] CI (`.github/workflows/release.yml`, `.github/workflows/test.yml`) confirmed to require no changes (JDK 17 already set via `actions/setup-java@v4`).
## References
- PR: https://github.com/Devasy/RepForge/pull/59
- Discussion: https://github.com/Devasy/RepForge/pull/59#issuecomment (see AGP 9 migration discussion thread)
- Requested by: `@Devasy`
EOF
)
issue_url=$(gh issue create \
--repo "$repo" \
--title "Migrate workout-logger/android to AGP 9.0+ for built-in Kotlin / new DSL support" \
--body "$body" \
--assignee "Devasy")
echo "Created issue: $issue_url"Length of output: 4282
(`ヘ´)凸 tracking this properly now — good luck when you tackle it! |
Summary by CodeRabbit